package hc.j2me.util;

import java.util.Date;

public class OutPortTranser {
	StringBuffer sb;
	
	public OutPortTranser() {
		sb = new StringBuffer();
	}
	
	public void out(Date bs){
		if(sb.length() > 0){
			sb.append(',');
		}
		
		sb.append("'" + String.valueOf(bs.getTime()) + "'");
	}
	
	public void out(String str){
		if(sb.length() > 0){
			sb.append(',');
		}
		
		sb.append("'" + str + "'");
	}
	
	public void out(boolean[] bs){
		if(sb.length() > 0){
			sb.append(',');
		}
		
		sb.append('[');
		for (int i = 0; i < bs.length; i++) {
			if(i == 0){
				
			}else{
				sb.append(',');
			}
			if(bs[i]){
				sb.append("'true'");
			}else{
				sb.append("'false'");
			}
		}
		sb.append(']');
	}
	
	public String getSubmitString(){
		return "{" + sb.toString() + "}";
	}
}
